Reduction algorithm